package com.effectivsocial.domain;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Size;

import lombok.Getter;
import lombok.Setter;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Type;
import org.hibernate.envers.Audited;
import org.hibernate.validator.constraints.NotEmpty;
import org.joda.time.DateTime;

/**
 * The persistent class for the leads database table.
 * 
 */
@Entity
@Table(name = "t_company")
@Audited
public class Company implements Serializable {
	private static final long serialVersionUID = 1L;
	
	@Getter @Setter
	@Id
	@GeneratedValue(generator = "uuid")
	@GenericGenerator(name = "uuid", strategy = "uuid2")
	@Column(name = "id", updatable = false, nullable = false, unique = true)
	private String id;
	
	@Getter @Setter
	@NotEmpty
	@Size(min = 2, max = 100)
	@Column(name = "name", length = 100,unique = true)
	private String name;
	
		
	@Getter @Setter
	@Column(name = "description", length = 250)
	private String description;
	
	@Getter @Setter
	@Column(name = "email", length = 100)
	private String email;
	
	
	@Getter @Setter
	@Column(name = "phone", length = 30)
	private String phone;
	
	
	@Getter @Setter
	@Column(name = "phone_other", length = 30)
	private String phoneOther;
	
	@Getter @Setter
	@Column(name="fax")
	private String fax;
	
	
	@Getter @Setter
	@Embedded
	private Address address;
	
	@Getter @Setter
	@Temporal(TemporalType.TIMESTAMP)
	@Type(type="org.jadira.usertype.dateandtime.joda.PersistentDateTime")
	@Column(name = "created_date", nullable = false, updatable = false)
	private DateTime createdDate;
	
	@Getter @Setter
	@Temporal(TemporalType.TIMESTAMP)
	@Type(type="org.jadira.usertype.dateandtime.joda.PersistentDateTime")
	@Column(name = "last_modified_date", nullable = false, updatable = false)
	private DateTime lastModifiedDate;
	
	
}
